<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>hamNeggs</title>
  <meta name="description" content="">
  <meta name="keywords" content="scrum,agile,project management">
  <meta http-equiv="Content-Type"
 content="text/html; charset=iso-8859-1">
    <style type="text/css">
		<%@ include file="/WEB-INF/css/style.css" %>
		<%@ include file="/WEB-INF/css/data_table_style.css" %>
	</style>
	<script src="jquery-1.4.4.min.js"> </script>
	
	<!-- Load DataTables resources  -->
	<script src="jquery.dataTables.js"> </script>
	
<script type="text/javascript">
	$(document).ready(function() {
	    $('#tableData').dataTable();
	} );
	$('#tableData').dataTable( {
        "aaSorting": [[ 1, "desc" ]],
		"sPaginationType": "full_numbers"
    } );
</script>
</head>
<body>
<div class="page-out">
<div class="page-in">
<div class="page">
<div class="main">
<div class="header">
<div class="header-top">
<h1><span>HamNeggs</span> Scrum App</h1>
</div>
<div class="header-bottom">
<h2>an easy web app for managing<br/>
your scrum projects.</h2>
<br/><br/> <h3> user stories management </h3> 
</div>
<div class="topmenu">
<ul>
  <li
 style="background: transparent none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; padding-left: 0px;"><a
 href="WelcomePage"><span>Home</span></a></li>
	<li><a href="ProjectManagement">Project</a></li>
	<li><a href="UserStoriesManagement">User Stories</a></li>
	<li><a href="SprintManagement">Sprints</a></li>
	<li><a href="MeetingManagement">Meetings</a></li>
	<li><a href="Login?action=logout">Logout</a></li>
</ul>
</div>
</div>
<div class="content">
<h2 class="sidebar1">User Stories for <c:out value="<%= session.getAttribute(\"projectName\")%>"/></h2>
<a href="CategoriesManagement" onclick="javascript:void window.open('CategoriesManagement','2','width=450,height=450,toolbar=0,menubar=0,location=1,status=1,scrollbars=1,resizable=1,left=0,top=0');return false;"><img src="images/category.jpeg"/></a>
<div id="contentResultsTable">
		 <p align="right"><a href="UserStoriesDetail" onclick="javascript:void window.open('UserStoriesDetail','1','width=450,height=450,toolbar=0,menubar=0,location=1,status=1,scrollbars=1,resizable=1,left=0,top=0');return false;"><img src="images/plus.jpeg"/></a></p>
                  <br /><br />
              <table cellpadding="0" cellspacing="0" border="0" id="tableData" class="display">
                  <thead>
                      <tr>
                          <th scope="col">Id</th>
                          <th scope="col">Name</th>
                          <th scope="col">State</th>
                          <th scope="col">Category</th>
                          <th scope="col">Estimated SP</th>
                          <th scope="col">Real SP</th>
                          <th scope="col">Sprint</th>
                          <th scope="col">Workflow</th>
                          <th scope="col">Actions</th>
                      </tr>
                  </thead>
                  <tbody>
                  <c:forEach items="${userStories}" var="sprint">	    
                  	<c:forEach items="${sprint.getValue()}" var="story">                    
                      <tr>
                  			<form action="UserStoriesManagement" method="post"> 
                  			<input type="hidden" name="ustid" value="${story.id}"/>     
                          <td><c:out value="${story.id}"/></td>
                          <td><c:out value="${story.name}"/></td>
                          <td><c:out value="${story.state}"/></td>
                          <td><c:out value="${story.stringCategory}"/></td>
                          <td><c:out value="${story.estimatedstoryPoints}"/></td>
                          <td><c:out value="${story.realstoryPoints}"/></td>
                          <td><c:out value="${sprint.getKey()}"/></td>
                          <td>
					     		<c:if test="${story.user != null && story.user == user && story.state == \"Created\" && sprint.getKey() != \"On Backlog\"}">
					     			<input id=startdev type="submit" name="action" value="StartDevelopment"/>   
					     		</c:if>
					     		<c:if test="${story.user != null && story.user == user && story.state == \"InProgress\"}">
					     			<input id=enddev type="submit" name="action" value="EndDevelopment"/>
					     			<b>SP: <input type="text" style="width: 10px; padding: 2px" name="realstoryPoints" value=""></b>  
					     		</c:if>
					     		<c:if test="${story.user != null && story.user == user && story.state == \"Finalized\" && rol == \"StakeHolder\"}">
					     			<input id=validate type="submit" name="action" value="Validate"/> 
					     		</c:if>
                          </td>
                          <td>
                          	<input id="minus" type="submit" name="action" value="Delete"/>
                          	<a href="UserStoriesDetail?id=${story.id}" onclick="javascript:void window.open('UserStoriesDetail?id=${story.id}','1','width=450,height=450,toolbar=0,menubar=0,location=1,status=1,scrollbars=1,resizable=1,left=0,top=0');return false;"><img src="images/edit.jpeg"/></a>
                          </td>
                    	</form>
                      </tr>	   
                    	</c:forEach>       
                    </c:forEach>                  
                  </tbody>
              </table>
 		</div> 
</div>
<div class="footer">
<!--DO NOT Remove The Footer Links-->
<a href="http://www.htmltemplates.net">
<img src="images/footer.gif" alt="html templates" border="0" height="1" width="1"></a>
<p>&copy; Copyright 2013. By Estefania Rabadan<br>
</p>
<ul>
  <li style="border-left: medium none;"><a href="index.html"><span>Home</span></a></li>
  <li><a href="#"><span>Contact</span></a></li>
  <li><a href="#"><span>Resources</span></a></li>
  <li style="padding-right: 0px;"><a href="#"><span>Links</span></a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</body>
</html>